<#include "../header.ftl" />
<@head title="论坛 - ${sitename}"/>
	<link media="all" href="${template_url}/style/bbs.css" rel="stylesheet">
	<@nav current="论坛"/>
	<div class="container">
		<div class="grid grid-4">
			<div class="box">
				<div class="box-title">版块列表</div>
			   	<div class="box-body">
			   		<div class="typo-p">
			   			<@m.widget path="/widget/forum/nav" idle=86400 cache=false/>
			   		</div>
			   	</div>
			</div>
		</div>
		<div class="grid grid-16 last">
			<#if (forumCatalogs?exists && forumCatalogs?size > 0)>
				<#list forumCatalogs as forumCatalog>
					<div class="bbs_fath">
						<h2>
							<span class="left">
								<span class="title"><a href="javascript:void(0);">${forumCatalog.name}</a></span>
						    </span>
						    <span class="amount">
						    	${forumCatalog.topics!"0"}主题，${forumCatalog.replys!"0"}回帖
						    	<a href="javascript:void(0);" onclick="collapsed('forum_catalog_${forumCatalog.id}', this);"><img src="${template_url}/images/bbs/collapsed_no.gif" /></a>
						    </span>
					  	</h2>
						<#if (forumCatalog.forums?exists && forumCatalog.forums?size > 0)>
						  	<div class="con" id="forum_catalog_${forumCatalog.id}">
						  		<#list forumCatalog.forums as forum>
						  			<dl class="bbs_son" id="">
					          			<dt><img alt="${forum.name}" src="${template_url}/images/bbs/forum.gif"></dt>
					          			<dd><strong><a href="${base}/forums/${forum.id}">${forum.name}</a></strong><span class="amount">${forum.topics!"0"}主题 / ${forum.replys!"0"}回帖</span></dd>
					        		</dl>
						  		</#list>
				    		</div>
				    	</#if>
			  		</div>
				</#list>
			</#if>
		</div>
	</div>
	<script type="text/javascript">
		function collapsed(catalog, btn){
			if($('#' + catalog).css('display') == 'none'){
				$('#' + catalog).slideDown();
				$(btn).children('img').attr('src', '${template_url}/images/bbs/collapsed_no.gif');
			}
			else{
				$('#' + catalog).slideUp();
				$(btn).children('img').attr('src', '${template_url}/images/bbs/collapsed_yes.gif');
			}
		}
	</script>
<#include "../footer.ftl" />